{"ast":null,"code":"var __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport classNames from 'classnames';\nimport FieldForm, { List, useWatch } from 'rc-field-form';\nimport * as React from 'react';\nimport { useMemo } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport DisabledContext, { DisabledContextProvider } from '../config-provider/DisabledContext';\nimport SizeContext, { SizeContextProvider } from '../config-provider/SizeContext';\nimport { FormContext } from './context';\nimport useForm from './hooks/useForm';\nimport useStyle from './style';\nconst InternalForm = (props, ref) => {\n  const contextSize = React.useContext(SizeContext);\n  const contextDisabled = React.useContext(DisabledContext);\n  const {\n    getPrefixCls,\n    direction,\n    form: contextForm\n  } = React.useContext(ConfigContext);\n  const {\n      prefixCls: customizePrefixCls,\n      className = '',\n      size = contextSize,\n      disabled = contextDisabled,\n      form,\n      colon,\n      labelAlign,\n      labelWrap,\n      labelCol,\n      wrapperCol,\n      hideRequiredMark,\n      layout = 'horizontal',\n      scrollToFirstError,\n      requiredMark,\n      onFinishFailed,\n      name\n    } = props,\n    restFormProps = __rest(props, [\"prefixCls\", \"className\", \"size\", \"disabled\", \"form\", \"colon\", \"labelAlign\", \"labelWrap\", \"labelCol\", \"wrapperCol\", \"hideRequiredMark\", \"layout\", \"scrollToFirstError\", \"requiredMark\", \"onFinishFailed\", \"name\"]);\n  const mergedRequiredMark = useMemo(() => {\n    if (requiredMark !== undefined) {\n      return requiredMark;\n    }\n    if (contextForm && contextForm.requiredMark !== undefined) {\n      return contextForm.requiredMark;\n    }\n    if (hideRequiredMark) {\n      return false;\n    }\n    return true;\n  }, [hideRequiredMark, requiredMark, contextForm]);\n  const mergedColon = colon !== null && colon !== void 0 ? colon : contextForm === null || contextForm === void 0 ? void 0 : contextForm.colon;\n  const prefixCls = getPrefixCls('form', customizePrefixCls);\n  // Style\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const formClassName = classNames(prefixCls, {\n    [`${prefixCls}-${layout}`]: true,\n    [`${prefixCls}-hide-required-mark`]: mergedRequiredMark === false,\n    [`${prefixCls}-rtl`]: direction === 'rtl',\n    [`${prefixCls}-${size}`]: size\n  }, hashId, className);\n  const [wrapForm] = useForm(form);\n  const {\n    __INTERNAL__\n  } = wrapForm;\n  __INTERNAL__.name = name;\n  const formContextValue = useMemo(() => ({\n    name,\n    labelAlign,\n    labelCol,\n    labelWrap,\n    wrapperCol,\n    vertical: layout === 'vertical',\n    colon: mergedColon,\n    requiredMark: mergedRequiredMark,\n    itemRef: __INTERNAL__.itemRef,\n    form: wrapForm\n  }), [name, labelAlign, labelCol, wrapperCol, layout, mergedColon, mergedRequiredMark, wrapForm]);\n  React.useImperativeHandle(ref, () => wrapForm);\n  const onInternalFinishFailed = errorInfo => {\n    onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errorInfo);\n    let defaultScrollToFirstError = {\n      block: 'nearest'\n    };\n    if (scrollToFirstError && errorInfo.errorFields.length) {\n      if (typeof scrollToFirstError === 'object') {\n        defaultScrollToFirstError = scrollToFirstError;\n      }\n      wrapForm.scrollToField(errorInfo.errorFields[0].name, defaultScrollToFirstError);\n    }\n  };\n  return wrapSSR( /*#__PURE__*/React.createElement(DisabledContextProvider, {\n    disabled: disabled\n  }, /*#__PURE__*/React.createElement(SizeContextProvider, {\n    size: size\n  }, /*#__PURE__*/React.createElement(FormContext.Provider, {\n    value: formContextValue\n  }, /*#__PURE__*/React.createElement(FieldForm, Object.assign({\n    id: name\n  }, restFormProps, {\n    name: name,\n    onFinishFailed: onInternalFinishFailed,\n    form: wrapForm,\n    className: formClassName\n  }))))));\n};\nconst Form = /*#__PURE__*/React.forwardRef(InternalForm);\nexport { useForm, List, useWatch };\nexport default Form;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","classNames","FieldForm","List","useWatch","React","useMemo","ConfigContext","DisabledContext","DisabledContextProvider","SizeContext","SizeContextProvider","FormContext","useForm","useStyle","InternalForm","props","ref","contextSize","useContext","contextDisabled","getPrefixCls","direction","form","contextForm","prefixCls","customizePrefixCls","className","size","disabled","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","restFormProps","mergedRequiredMark","undefined","mergedColon","wrapSSR","hashId","formClassName","wrapForm","__INTERNAL__","formContextValue","vertical","itemRef","useImperativeHandle","onInternalFinishFailed","errorInfo","defaultScrollToFirstError","block","errorFields","scrollToField","createElement","Provider","value","assign","id","Form","forwardRef"],"sources":["/data/messenger.client/node_modules/antd/es/form/Form.js"],"sourcesContent":["var __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport classNames from 'classnames';\nimport FieldForm, { List, useWatch } from 'rc-field-form';\nimport * as React from 'react';\nimport { useMemo } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport DisabledContext, { DisabledContextProvider } from '../config-provider/DisabledContext';\nimport SizeContext, { SizeContextProvider } from '../config-provider/SizeContext';\nimport { FormContext } from './context';\nimport useForm from './hooks/useForm';\nimport useStyle from './style';\nconst InternalForm = (props, ref) => {\n  const contextSize = React.useContext(SizeContext);\n  const contextDisabled = React.useContext(DisabledContext);\n  const {\n    getPrefixCls,\n    direction,\n    form: contextForm\n  } = React.useContext(ConfigContext);\n  const {\n      prefixCls: customizePrefixCls,\n      className = '',\n      size = contextSize,\n      disabled = contextDisabled,\n      form,\n      colon,\n      labelAlign,\n      labelWrap,\n      labelCol,\n      wrapperCol,\n      hideRequiredMark,\n      layout = 'horizontal',\n      scrollToFirstError,\n      requiredMark,\n      onFinishFailed,\n      name\n    } = props,\n    restFormProps = __rest(props, [\"prefixCls\", \"className\", \"size\", \"disabled\", \"form\", \"colon\", \"labelAlign\", \"labelWrap\", \"labelCol\", \"wrapperCol\", \"hideRequiredMark\", \"layout\", \"scrollToFirstError\", \"requiredMark\", \"onFinishFailed\", \"name\"]);\n  const mergedRequiredMark = useMemo(() => {\n    if (requiredMark !== undefined) {\n      return requiredMark;\n    }\n    if (contextForm && contextForm.requiredMark !== undefined) {\n      return contextForm.requiredMark;\n    }\n    if (hideRequiredMark) {\n      return false;\n    }\n    return true;\n  }, [hideRequiredMark, requiredMark, contextForm]);\n  const mergedColon = colon !== null && colon !== void 0 ? colon : contextForm === null || contextForm === void 0 ? void 0 : contextForm.colon;\n  const prefixCls = getPrefixCls('form', customizePrefixCls);\n  // Style\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const formClassName = classNames(prefixCls, {\n    [`${prefixCls}-${layout}`]: true,\n    [`${prefixCls}-hide-required-mark`]: mergedRequiredMark === false,\n    [`${prefixCls}-rtl`]: direction === 'rtl',\n    [`${prefixCls}-${size}`]: size\n  }, hashId, className);\n  const [wrapForm] = useForm(form);\n  const {\n    __INTERNAL__\n  } = wrapForm;\n  __INTERNAL__.name = name;\n  const formContextValue = useMemo(() => ({\n    name,\n    labelAlign,\n    labelCol,\n    labelWrap,\n    wrapperCol,\n    vertical: layout === 'vertical',\n    colon: mergedColon,\n    requiredMark: mergedRequiredMark,\n    itemRef: __INTERNAL__.itemRef,\n    form: wrapForm\n  }), [name, labelAlign, labelCol, wrapperCol, layout, mergedColon, mergedRequiredMark, wrapForm]);\n  React.useImperativeHandle(ref, () => wrapForm);\n  const onInternalFinishFailed = errorInfo => {\n    onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errorInfo);\n    let defaultScrollToFirstError = {\n      block: 'nearest'\n    };\n    if (scrollToFirstError && errorInfo.errorFields.length) {\n      if (typeof scrollToFirstError === 'object') {\n        defaultScrollToFirstError = scrollToFirstError;\n      }\n      wrapForm.scrollToField(errorInfo.errorFields[0].name, defaultScrollToFirstError);\n    }\n  };\n  return wrapSSR( /*#__PURE__*/React.createElement(DisabledContextProvider, {\n    disabled: disabled\n  }, /*#__PURE__*/React.createElement(SizeContextProvider, {\n    size: size\n  }, /*#__PURE__*/React.createElement(FormContext.Provider, {\n    value: formContextValue\n  }, /*#__PURE__*/React.createElement(FieldForm, Object.assign({\n    id: name\n  }, restFormProps, {\n    name: name,\n    onFinishFailed: onInternalFinishFailed,\n    form: wrapForm,\n    className: formClassName\n  }))))));\n};\nconst Form = /*#__PURE__*/React.forwardRef(InternalForm);\nexport { useForm, List, useWatch };\nexport default Form;"],"mappings":"AAAA,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC,EAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CAACL,CAAC,CAAC,GAAG,CAAC,EAAED,CAAC,CAACC,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC;EAChG,IAAIH,CAAC,IAAI,IAAI,IAAI,OAAOI,MAAM,CAACK,qBAAqB,KAAK,UAAU,EAAE,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEP,CAAC,GAAGC,MAAM,CAACK,qBAAqB,CAACT,CAAC,CAAC,EAAEU,CAAC,GAAGP,CAAC,CAACQ,MA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